|
|   Rules for the game of exorcist patience
|   Designed by J.Horsnell
|   For SPatience Vsn. 0.51
|
|   This is my own (quickly thought up) game.
|   It's not very difficult, enjoy....
|   The stacks on the left are of the same
|   colour descending value variety.  Those
|   on the right are of the different colour
|   descending variety.  Whole stacks must
|   conform to the rules when moving to a new
|   home. The pack deal one to each stack.
|
| This file may provide as an introduction to
| writing SPatience script files of your own.
|
| SPatience knows one script type at the moment but it must be declared
SCRIPT_TYPE 1
|

| Open a window with this title. (case sensitive inside quotes)
BEGIN "Exorcist patience"

  | Declare the game state flag defaults
  FLAGS ClickFly AutoFly AnimateFly

  | We need 4 packs for this game
  PACKS 4

  | The window width is 17 stack widths plus a little for the border
  WIDTH 17 * CW + 14

  | Lets have a generous height (30 card card_stack plus a stack)
  HEIGHT 16 + CH + 1244

  | We win if there are 208 cards (all of them) in the foundations
  ZeroToWin 208 - CARDSIN$2

  | Now define the foundations.
  FOR foundation = 0 to 7

    | These are standard foundations, mostly default.
    | First the left eight.
    FOUNDATION
      X 14 + CW * foundation
      Y 16
    END FOUNDATION

    | Now the right...
    FOUNDATION
      X 14 + 16 * CW - foundation * CW
      Y 16
    END FOUNDATION

  END FOR

  | Now for the stacks (eight left, eight right)
  FOR stack = 0 TO 7

    | First the left
    STACK
      | Each one below a foundation
      X 14 + stack * CW
      Y 16 + CH
      | Allow only kings to be placed on empty stacks
      FIRST 13
      | An upper limit of thirty cards on each
      MAX 30
      | We want one card on the left increasing to eight in the middle
      DEAL stack + 1 , stack + 1
      | We need deep stack checking when adding stacks
      | and only cards of the same colour can be added.
      | The card value offset is the default of decrementing by one.
      | These stacks can also accept cards after a click operation.
      FLAGS PaintDown DeepCheck ClickFly Join__SC
      | An ID of 1, this is were the pack will deal to.
      ID 1
    END STACK

    | Now the right
    STACK
      | One card at the far right, eight in the middle
      X 14 + 16 * CW - stack * CW
      | All else is the same as those on the left....
      Y 16 + CH
      FIRST 13
      MAX 30
      DEAL stack + 1 , stack + 1
      | Except the way stacks append (different colour)
      FLAGS DeepCheck ClickFly Join__DC
      ID 1
    END STACK

  END FOR

  | We need a stack to hold the cards left to deal.
  STACK
    | Put it in the middle of the foundations
    X 14 + 8 * CW
    Y 16
    | We don't want any cards to be added
    MAX 0
    | After the stacks, there are 136 cards left....
    DEAL 136
    | To each stack (ID=1) we deal one card.
    DEALTO 1,1
    | We don't want to take them back when dealt.
    TAKEFROM 0
    | The pack is deal only, no dragging.
    DRAGUPTO 0
    | It's display should be the card back and a count of cards left
    FLAGS PaintCount
  END STACK

END BEGIN
